Skip to content

[win][arm64ec] Fix finding assembler and setting is_arm for Arm64EC #1511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

dpaoliello
Copy link
Contributor

No description provided.

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Just one refactor required

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@NobodyXu NobodyXu merged commit ca81dcc into rust-lang:main Aug 10, 2025
75 checks passed
@NobodyXu
Copy link
Collaborator

@dpaoliello
Copy link
Contributor Author

clang: error: unknown argument: '-?'

Errr... doesn't seem related to my change. It shouldn't have affected non-MSVC targets...

@dpaoliello dpaoliello deleted the arm64ecfixes branch August 10, 2025 03:28
@dpaoliello
Copy link
Contributor Author

Hmm... This is for build-std with nightly, did something break in the Rust project?

@NobodyXu
Copy link
Collaborator

Maybe? i was thinking if there's some
new commits on main, combine with this PR, cause the failure

@NobodyXu
Copy link
Collaborator

Took another look, you are right, it's probably a nightly issue

@dpaoliello
Copy link
Contributor Author

Looks like those compiler warnings were red herrings, the real error is:

note: ld: building for 'visionOS-simulator', but linking in object file (/Users/runner/work/cc-rs/cc-rs/target/aarch64-apple-visionos-sim/debug/build/cc-test-55b62b3e97617bab/out/libOptLinkage.a[2](ea708c7824d36062-opt_linkage.o)) built for 'visionOS'

@dpaoliello
Copy link
Contributor Author

dpaoliello commented Aug 10, 2025

I believe the root cause is rust-lang/rust#139451 (cc @madsmtm)

Looking at: https://github.com/rust-lang/rust/pull/139451/files#diff-e8d43d302ad15ae5c24ca635b7a9abd544a4bac8b12b086b3f71c8da49e68538

Seems that sim was changed from an abi to env, which breaks the checks in cc:

match (self.os, self.abi) {
("macos", "") => format!("-mmacosx-version-min={min_version}"),
("ios", "") => format!("-miphoneos-version-min={min_version}"),
("ios", "sim") => format!("-mios-simulator-version-min={min_version}"),
("ios", "macabi") => format!("-mtargetos=ios{min_version}-macabi"),
("tvos", "") => format!("-mappletvos-version-min={min_version}"),
("tvos", "sim") => format!("-mappletvsimulator-version-min={min_version}"),
("watchos", "") => format!("-mwatchos-version-min={min_version}"),
("watchos", "sim") => format!("-mwatchsimulator-version-min={min_version}"),
// `-mxros-version-min` does not exist
// https://github.com/llvm/llvm-project/issues/88271
("visionos", "") => format!("-mtargetos=xros{min_version}"),
("visionos", "sim") => format!("-mtargetos=xros{min_version}-simulator"),
(os, _) => panic!("invalid Apple target OS {}", os),
}

@wesleywiser can we do a crater run with nightly? Seems like this is a breaking change...

Guessing the fix in cc is to check both abi AND env?

@NobodyXu
Copy link
Collaborator

Fixed in #1517

@NobodyXu
Copy link
Collaborator

Thank you for finding the rust PR for me!

@wesleywiser
Copy link
Member

I don't think a crater run will really find anything as it effectively can only test {i686,x86_64}-unknown-linux-{gnu,musl}. Even the breakage detected in CI here would not have been uncovered by crater as far as I can tell.

I agree there's a compatibility concern here but that was disclosed on rust-lang/rust#139451 and the compiler team FCP'd the change. I'll make sure we have a release note for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants